cudgel (someone's) brains

Translations
ломать голову (кому-то)
They were cudgeling their brains trying to remember where they left the keys.
Они ломали голову, пытаясь вспомнить, где оставили ключи.